<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue列表展示</title>
</head>

<body>
  <div id="app">
    <h2>{{message}}</h2>
    <ul><!-- v-for第二个参数可以是当前项的索引index -->
      <li v-for="(item, index) in movies" :key="index">{{item}}</li>
    </ul>
  </div>

  <script src="./js/vue.js"></script>
  <script>
    const app = new Vue({
      el: "#app", //用于挂载要管理的元素
      data: { //定义数据
        message: "你好啊",
        movies: ["星际穿越", "海王", "大话西游", "复仇者联盟"] //定义一个数组
      }
    })
  </script>

</body>

</html>